<% custom_fields = nav_menu.get_field_groups.any? %>
<ol class="dd-list">
    <% items.each do |item|
      item_data = zerocms_parse_menu_item(item, true)
      item_data[:url_edit] = url_for(action: :edit_menu_item, nav_menu_id: nav_menu.id, id: item.id) if item.kind == 'external'
      next  unless item_data.present?
    %>
        <li class="dd-item" data-id="<%= item.id %>">
            <div class="dd-handle dd3-handle"></div>
            <div class="dd3-content"><span><%= item_data[:name] %></span>
                <span class="label label-default"><%= item.kind %></span>
                <%= link_to('<i class="fa fa-edit"></i>'.html_safe, item_data[:url_edit], target: '_blank', title: t('.edit_menu_item', default: 'Edit Menu Item'), class: "item_#{item.kind}") if item_data[:url_edit].present? %>
                <%= link_to('<i class="fa fa-cog"></i>'.html_safe, {action: :custom_settings, nav_menu_id: nav_menu.id, id: item.id, zerocms_skip_breadcrumb: true}, class: 'custom_settings_link', title: t('.edit_custom_settings', default: 'Edit Configurations')) if custom_fields %>
                <%= link_to('<i class="fa fa-times-circle"></i>'.html_safe, url_for(action: :delete_menu_item, nav_menu_id: nav_menu.id, id: item.id), class: 'delete_menu_item') %>
            </div>
            <%= render('menu_items', items: item.children.reorder(:term_order), nav_menu: nav_menu) if item.children.any? %>
        </li>
    <% end %>
</ol>